<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript" src="js/vue.js"></script>
	</head>
	<body>
		<div id="app">
			{{msg}}
			<!-- {{say()}} -->
			{{whatColor("red")}}
			<button @click="whatColor('green')">点我有惊喜</button>
			<button @click="whatColor('red')">点我有惊吓</button>
		</div>
	</body>
	<script type="text/javascript">
		new Vue({
			el:"#app",
			data:{
				msg:"hello VueJS!"
			},
			methods:{//所有的函数必须在这里定义
				//函数的声明
				say:function(){
					alert("hello");
				},
				whatColor:function(color){
					console.log("vue"+color);
				}
			}
		})
	</script>
</html>
